<script type="text/javascript">
	var intCurYear = '<?php echo $intYear ?>';
	var intCurMonth = '<?php echo $intMonth ?>';

	function searchMonth(intYear, intMonth)
	{
		var strPars = '?page=1';

		if ($('keyword')) {
			trimElementValue('keyword');
			var strKeyword = $('keyword').value;
			if (strKeyword.length > 0) {
				strPars += '&keyword=' + strKeyword;
			}
		}
		strPars += '&year=' + intYear + '&month=' + intMonth;

		searchAjax(strPars);
	}

	function updateMonthPaging(intYear, intMonth)
	{
		$('yearNumber').innerHTML = intYear;
		for (intIndex = 1; intIndex <= 12; intIndex++) {
			$('month_' + intIndex).removeClassName('nowMonth');
		}
		$('month_' + intMonth).addClassName('nowMonth');

		intCurYear = intYear;
		intCurMonth = intMonth;
	}
</script>

<dl id="entrySortArea">
	<dt>
		<a href="javascript:void(0)" onclick="searchMonth(parseInt(intCurYear) - 1, 12)">
			<img class="narrow" src="<?php echo image_path('paging_l.gif') ?>" />
		</a>
		<span id="allYear"><span id="yearNumber"><?php echo $intYear ?></span><span id="yearText">年</span></span>
		<a href="javascript:void(0)" onclick="searchMonth(parseInt(intCurYear) + 1, 1)">
			<img class="parrow" src="<?php echo image_path('paging_r.gif') ?>" />
		</a>
	</dt>
	<dd><a href="javascript:void(0)" id="month_1" onclick="searchMonth(intCurYear, 1)">1月</a></dd>
	<dd><a href="javascript:void(0)" id="month_2" onclick="searchMonth(intCurYear, 2)">2月</a></dd>
	<dd><a href="javascript:void(0)" id="month_3" onclick="searchMonth(intCurYear, 3)">3月</a></dd>
	<dd><a href="javascript:void(0)" id="month_4" onclick="searchMonth(intCurYear, 4)">4月</a></dd>
	<dd><a href="javascript:void(0)" id="month_5" onclick="searchMonth(intCurYear, 5)">5月</a></dd>
	<dd><a href="javascript:void(0)" id="month_6" onclick="searchMonth(intCurYear, 6)">6月</a></dd>
	<dd><a href="javascript:void(0)" id="month_7" onclick="searchMonth(intCurYear, 7)">7月</a></dd>
	<dd><a href="javascript:void(0)" id="month_8" onclick="searchMonth(intCurYear, 8)">8月</a></dd>
	<dd><a href="javascript:void(0)" id="month_9" onclick="searchMonth(intCurYear, 9)">9月</a></dd>
	<dd><a href="javascript:void(0)" id="month_10" onclick="searchMonth(intCurYear, 10)">10月</a></dd>
	<dd><a href="javascript:void(0)" id="month_11" onclick="searchMonth(intCurYear, 11)">11月</a></dd>
	<dd class="lastItem on"><a href="javascript:void(0)" id="month_12" onclick="searchMonth(intCurYear, 12)">12月</a></dd>
</dl>

<script type="text/javascript">
	$('month_' + intCurMonth).addClassName('nowMonth');
</script>
